package com.softlab.retailwholesalesystem.entity;


import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

/**
 * 货物实体类
 */
//@Data
@TableName(value = "t_goods")
@AllArgsConstructor
@NoArgsConstructor
public class GoodsEntity implements Serializable {

    @TableId(type= IdType.AUTO)
    private Long goodsId;
    private String goodsName;
    private Double stockPrice;
    private Double aPrice;
    private Double bPrice;
    private Double cPrice;

    @TableField(fill= FieldFill.INSERT)
    private Date createTime;
    @TableField(fill= FieldFill.INSERT_UPDATE)
    private Date modifiedTime;
    private Integer isDelete;
    @TableField(exist = false)
    private Double unsoldMoney;

    @Override
    public String toString() {
        return "GoodsEntity{" +
                "goodsId=" + goodsId +
                ", goodsName='" + goodsName + '\'' +
                ", stockPrice=" + stockPrice +
                ", aPrice=" + aPrice +
                ", bPrice=" + bPrice +
                ", cPrice=" + cPrice +
                ", createTime=" + createTime +
                ", modifiedTime=" + modifiedTime +
                ", isDelete=" + isDelete +
                ", unsoldMoney=" + unsoldMoney +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        GoodsEntity goods = (GoodsEntity) o;
        return Objects.equals(goodsId, goods.goodsId) && Objects.equals(goodsName, goods.goodsName) && Objects.equals(stockPrice, goods.stockPrice) && Objects.equals(aPrice, goods.aPrice) && Objects.equals(bPrice, goods.bPrice) && Objects.equals(cPrice, goods.cPrice) && Objects.equals(createTime, goods.createTime) && Objects.equals(modifiedTime, goods.modifiedTime) && Objects.equals(isDelete, goods.isDelete) && Objects.equals(unsoldMoney, goods.unsoldMoney);
    }

    @Override
    public int hashCode() {
        return Objects.hash(goodsId, goodsName, stockPrice, aPrice, bPrice, cPrice,  createTime, modifiedTime, isDelete);
    }

    public Long getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(Long goodsId) {
        this.goodsId = goodsId;
    }

    public String getGoodsName() {
        return goodsName;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }

    public Double getStockPrice() {
        return stockPrice;
    }

    public void setStockPrice(double stockPrice) {
        this.stockPrice = stockPrice;
    }

    public Double getaPrice() {
        return aPrice;
    }

    public void setaPrice(double aPrice) {
        this.aPrice = aPrice;
    }

    public Double getbPrice() {
        return bPrice;
    }

    public void setbPrice(double bPrice) {
        this.bPrice = bPrice;
    }

    public Double getcPrice() {
        return cPrice;
    }

    public void setcPrice(double cPrice) {
        this.cPrice = cPrice;
    }


    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getModifiedTime() {
        return modifiedTime;
    }

    public void setModifiedTime(Date modifiedTime) {
        this.modifiedTime = modifiedTime;
    }

    public Integer getIsDelete() {
        return isDelete;
    }

    public Double getUnsoldMoney() {
        return unsoldMoney;
    }

    public void setUnsoldMoney(Double unsoldMoney) {
        this.unsoldMoney = unsoldMoney;
    }

    public void setIsDelete(Integer isDelete) {
        this.isDelete = isDelete;
    }
}
